package com.gexin.model.activity;

import com.gexin.model.activity.base.BaseMemberCashCouponLog;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.UUID;

/**
 * 业务名称:  t_member_cash_coupon_log()
 */
@SuppressWarnings("serial")
public class MemberCashCouponLog extends BaseMemberCashCouponLog<MemberCashCouponLog> {
	public static final MemberCashCouponLog dao = new MemberCashCouponLog();

	public  void setCommonCoupStatusDescType(String userId,
		BigDecimal productIntegral, BigDecimal speedIntegral,
		int incomeor, String desc, int type, BigDecimal incrementCoin,
		BigDecimal incrementBillOfShopping, BigDecimal incrementReserve){

		this.setId(UUID.randomUUID()+"");
		this.setCoupon(productIntegral);
		this.setRemainCoupon(speedIntegral);
		this.setUserId(userId);
		this.setDesc(desc);
		this.setIncomeOr(incomeor);
		this.setType(type);

		this.setCoin(incrementCoin);
		this.setBillOfShopping(incrementBillOfShopping);
		this.setReserve(incrementReserve);

		long date = new Date().getTime();
		this.setCreateTime(date);
		this.setUpdateTime(date);
	}

	public List<MemberCashCouponLog> findByUserId(String id) {
		return MemberCashCouponLog.dao.find(
				"select * from t_member_cash_coupon_log where user_id="+id+" order by create_time desc");
	}



}
